
{extend name='index/main'}

{block name='main'}
<div class="layui-layout">
    <fieldset class="layui-elem-field layui-field-title" >
        <legend>模型管理</legend>
        <blockquote class="layui-elem-quote">
            <form class="layui-form layui-form-pane" action="" method="post" lay-filter="search">
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <div class="layui-input-inline">
                            <input type="text" name="title" placeholder="角色名称" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-input-inline">
                            <button class="layui-btn lay-submit">
                                <i class="layui-icon">&#xe615;</i> 搜索
                            </button>
                        </div>
                    </div>
                </div>


            </form>
        </blockquote>
    </fieldset>

    <form class="layui-form layui-form-pane" action="" method="post" lay-filter="list-table">
        <blockquote class="layui-elem-quote layui-quote-nm">
            <button class="layui-btn" lay-submit data-url="{:url('models/pdel')}" data-call-back="table_pdel">
                批量删除
            </button>

            <button class="layui-btn link" data-type="page" data-url="{:url('models/add')}" style="float: right">
                添加
            </button>
        </blockquote>

        <div class="layui-form">
            <table class="layui-table" lay-filter="layui-table"
                   lay-data="{height:500, url:'{:url('models/index')}',method:'post',response:{statusCode:1},page:true,limit:10,limits:[20,30,60,100]}">
                <thead>
                <tr>
                    <th lay-data="{checkbox:true}" ></th>
                    <th lay-data="{field:'id', width:100 ,align: 'center'}">id</th>
                    <th lay-data="{field:'module_id', width:100 ,align: 'center'}">所属模块ID</th>
                    <th lay-data="{field:'models_name', width:100 ,align: 'center'}">模型名称</th>
                    <th lay-data="{field:'table_name', width:100 ,align: 'center'}">模型表</th>
                    <th lay-data="{field:'add_time', width:100 ,align: 'center'}">添加时间</th>
                    <th lay-data="{  width:200 ,toolbar: '#actionTpl',fixed:'right'}">操作</th>
                </tr>
                </thead>

                <script type="text/html" id="actionTpl" lay-filter="actionbar">
                    <div class="layui-btn-group">
                        <span data-url="{:url('models/edit')}" data-field="id" class="layui-btn layui-btn-sm" lay-event="edit">编辑</span>
                        <span data-url="{:url('models/del')}"  class="layui-btn layui-btn-sm layui-btn-danger" lay-event="action" confirm-msg="已生成的`数据表`删除？" confirm-type="del">删除</span>
                        <span data-url="{:url('models/alldel')}"  class="layui-btn layui-btn-sm layui-btn-danger" lay-event="action" confirm-msg="已生成的`数据表，文件,菜单`全部删除？" confirm-type="del">彻底删除</span>
                    </div>
                </script>
            </table>
        </div>

        <blockquote class="layui-elem-quote layui-quote-nm">
            <button class="layui-btn" lay-submit data-url="{:url('models/pdel')}" data-call-back="table_pdel">
                批量删除
            </button>

            <button class="layui-btn link" data-type="page" data-url="{:url('models/add')}" style="float: right">
                添加
            </button>
        </blockquote>
    </form>
</div>

<script type="text/javascript" src="__PLUGIN_PATH__/layui/layui.js"></script>
<script type="text/javascript" src="__PLUGIN_PATH__/lay-extend-module/config.js"></script>
<script>
    layui.use(['table','tableExtend'],function(){
        var table = layui.table
            ,tableExtend = layui.tableExtend;
        table.on('tool(layui-table)',tableExtend._tool);
    })

</script>

{/block}